import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity('page', { schema: 'db_lowcode' })
export class Page {
  @PrimaryGeneratedColumn({ type: 'int', name: 'id', comment: '页面ID' })
  id: number;

  @Column('int', { name: 'account_id', comment: '账户ID' })
  accountId: number;

  @Column('varchar', { name: 'page_name', comment: '页面名称', length: 50 })
  pageName: string;

  @Column('varchar', { name: 'tdk', comment: 'TDK', length: 50 })
  tdk: string;

  @Column('varchar', { name: 'desc', comment: '描述', length: 100 })
  desc: string;

  @Column('tinyint', {
    name: 'status',
    comment: '状态1 启用 0 禁用',
    width: 1,
    default: () => "'1'",
  })
  status: boolean;

  @Column('timestamp', {
    name: 'create_time',
    comment: '创建时间',
    default: () => 'CURRENT_TIMESTAMP',
  })
  createTime: Date;

  @Column('timestamp', {
    name: 'update_time',
    comment: '更新时间',
    default: () => 'CURRENT_TIMESTAMP',
  })
  updateTime: Date;
}
